﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using br.com.SistemaChamados.Enum;
using br.com.SistemaChamados.Model;
using br.com.SistemaChamados.DAO;
using System.Data;

namespace br.com.SistemaChamados.Controller
{
    public class CallController
    {
        public EnumGenericState InsertCall(Call call)
        {
            EnumGenericState resultCall = EnumGenericState.GENERIC_STATE_UNKNOW;
            try
            {
                CallDAO callDAO = new CallDAO();
                resultCall = callDAO.InsertCall(call);
            }
            catch (Exception ex)
            {
                resultCall = EnumGenericState.GENERIC_STATE_FAILED;
                throw ex;
            }
            return resultCall;
        }

        public int? GetCallId()
        {
            int? resultCall = null;
            try
            {
                CallDAO callDAO = new CallDAO();
                resultCall = callDAO.GetCallId();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return resultCall;
        }
        public CallController()
        {
            //
            // TODO: Add constructor logic here
            //
        }
    }
}